//
//  SWRefresh.swift
//  SinaWeibo
//
//  Created by wszyxc on 16/7/26.
//  Copyright © 2016年 wszyxc. All rights reserved.
//

import UIKit
import MJRefresh

class SWRefresh: MJRefreshNormalHeader {


    override init(frame: CGRect) {
        super.init(frame: frame)
        
        //
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    private func setupUI(){

        //设置文字
        self.setTitle("下拉刷新", forState: MJRefreshState.Idle)
        self.setTitle("松开刷新", forState: .Pulling)
        self.setTitle("刷新中", forState: .Refreshing)
        
        //设置字体
        self.stateLabel?.font = UIFont.systemFontOfSize(15)
        //设置颜色
        self.stateLabel?.textColor = UIColor.whiteColor()
        
        //隐藏刷新时间的label
        self.lastUpdatedTimeLabel?.hidden = true
      
        self.backgroundColor = THEMECOLOR
        //自动透明度
        self.automaticallyChangeAlpha = true
        
    }
    

}
